pub fn number(user_number: &str) -> Option<String> {
    let mut num_str = user_number
        .split(|c: char| !c.is_numeric())
        .filter(|&c| !c.is_empty())
        .collect::<Vec<&str>>()
        .join("");

    let mut result = String::new();

    if num_str.len() != 10 && num_str.len() != 11 { return None; }
    if num_str.len() == 11 {
        if let Some(f) = num_str.chars().next() {
            if f != '1' { return None; }
        }
        num_str.remove(0);
    }

    for (idx, ch) in num_str.chars().enumerate() {
        if idx == 0 || idx == 3 {
            if ch == '0' || ch == '1' {
                return None;
            }
        }
        result.push(ch);
    }
    Some(result)
}

#[test]
#[ignore]
fn valid_when_11_digits_and_starting_with_1() {
    let input = "12234567890";
    let output = number(input);
    let expected = Some("2234567890".into());
    assert_eq!(output, expected);
}